Repository navigation
fix(window): reflow on macOS occlusion-reveal so the bottom bar is not clipped - #10056
Merged
Merged
Conversation
…t clipped
Fixes STA-2383.
On macOS the window is background-throttled while hidden; on occlusion-uncover only 'focus' fires and its handler runs webContents.invalidate() (the setSize jiggle is skipped to avoid SIGWINCH-ing terminals). invalidate() repaints but does not reflow, so the app-shell h-dvh root keeps a stale dynamic-viewport height and the StatusBar is clipped below the viewport ('no bottom bar'); a manual resize restores it.
Fix: renderer relays a genuine hidden->visible reveal (visibilitychange) to main via new ui.notifyWindowRevealed IPC; main runs the same proven forceRepaint. Occlusion-gated (no per-Cmd+Tab SIGWINCH regression), darwin-scoped, sender-guarded, cleaned up on close.
Test plan: vitest createMainWindow + web-preload-api green. Recommend on-device macOS occlusion QA before merge.
Contributor
📝 WalkthroughWalkthroughAdds a macOS renderer visibility listener and preload API method that emit 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Jul 27, 2026
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…t clipped (stablyai#10056) * fix(window): reflow on macOS occlusion-reveal so the bottom bar is not clipped Fixes STA-2383. On macOS the window is background-throttled while hidden; on occlusion-uncover only 'focus' fires and its handler runs webContents.invalidate() (the setSize jiggle is skipped to avoid SIGWINCH-ing terminals). invalidate() repaints but does not reflow, so the app-shell h-dvh root keeps a stale dynamic-viewport height and the StatusBar is clipped below the viewport ('no bottom bar'); a manual resize restores it. Fix: renderer relays a genuine hidden->visible reveal (visibilitychange) to main via new ui.notifyWindowRevealed IPC; main runs the same proven forceRepaint. Occlusion-gated (no per-Cmd+Tab SIGWINCH regression), darwin-scoped, sender-guarded, cleaned up on close. Test plan: vitest createMainWindow + web-preload-api green. Recommend on-device macOS occlusion QA before merge. * fix(window): preserve user resizes during reveal repaint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes STA-2383 ("no bottom bar" after the window is uncovered).
Root cause
On macOS the main window is background-throttled while fully occluded. When it is uncovered again, no
restore/showfires — onlyfocus— and thefocushandler deliberately runswebContents.invalidate()only (the setSize jiggle there would SIGWINCH every terminal on every Cmd+Tab).invalidate()repaints but does not reflow, so the app-shellh-dvhroot keeps the stale dynamic-viewport height it had while throttled. The layout is taller than the real window, and the StatusBar at the bottom of that root sits below the viewport — "no bottom bar" until a manual resize forces a reflow.Before / after
Same 1200×620 window. In the before shot the root is laid out ~100 px taller than the window, so the bottom StatusBar (usage/memory bar) is clipped off-screen; after the reflow it is back. (Visual pair staged by pinning the root to the stale height in the live app — the organic repro needs a viewport change while the renderer is throttled, which the automated rig can't produce without Accessibility access. The fix's actual trigger path is verified live below.)
Fix
The renderer relays a genuine hidden→visible reveal (
visibilitychange) to main via a newui.notifyWindowRevealedIPC; main runs the same provenforceRepaint(invalidate + setSize jiggle) thatshow/restore/resume already get, which forces the reflow that recomputes the stale layout.visibilityState, so plain Cmd+Tab focus switches still never jiggle (no per-focus SIGWINCH regression). Only genuine occlusion-reveals — exactly the broken case — trigger it.event.sendermust be the main window's webContents, listener removed in the sameclosedhandler as the existing repaint timer.width+1 × height, so a real user resize/maximize/fullscreen during the jiggle owns the final bounds.Live verification (dev build, real occlusion)
Covered the window with another app's window for ~25–75 s, then uncovered it, with in-page event recorders and a temporary main-process log:
visibilitychange→hiddenon cover,visibleon uncover (genuine occlusion transitions, backgroundThrottling on).reveal IPC accepted -> forceRepaint— the relay fires and passes the sender guard on uncover.macOS 26 note (post-#10253 merge)
main's #10253 makesforceRepaintskip the setSize nudge entirely on macOS 26+ (re-entrant frame updates can deadlock AppKit there), so on Tahoe this reveal path degrades to invalidate-only — the reveal IPC still fires (verified live on a macOS 26 machine) but the reflow does not. On macOS ≤ 15 the full fix applies. If STA-2383 reports come in from macOS 26, the follow-up needs a frame-safe reflow trigger (renderer-side) rather than un-gating the jiggle.Test plan
createMainWindow.test.ts(77 ✓): reveal → full repaint with deferred nudge, wrong-sender no-op, jiggle dedup on repeated reveals, mid-jiggle user-resize preservation, listener cleanup on close, Tahoe nudge skip, focus stays invalidate-only.web-preload-api.test.ts(79 ✓): paired-web stub.